import request from '@/utils/request'

// 查询模板列表
export function modellist(query) {
    return request({
        url: '/template/template/list',
        method: 'get',
        params: query
    })
}


// 删除模板
export function modellistdelete(ids) {
  return request({
    url: `/template/template/${ids}`,
    method: 'delete'
  })
}

//获取试题模板详细信息
export function edittemplate(id) {
  return request({
    url: `/template/template/${id}`,
    method: 'get'
  })
}

//创建模板
export function createModel(data) {
  return request({
    url: '/template/template',
    method: 'post',
    data: data
  })
}

//考试学科列表
export function modellistsubject(query) {
    return request({
        url: '/system/exam/subject/list',
        method: 'get',
        params: query
    })
}

//获取教师列表
export function getteacherlist(query) {
    return request({
        url: '/system/user/list',
        method: 'get',
        params: query
    })
}

//上传模板文件
export function updatamodelcase(data) {
  return request({
    url: '/template/template/uploadTemplate',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: data
  })
}

//根据模板id获取模板信息 
export function templateIdinfo(query) {
    return request({
        url: '/template/page/getListByTemplateId',
        method: 'get',
        params: query
    })
}

//新增编辑模板题卡页 
export function addTemplateinfo(data) {
  return request({
    url: '/template/page',
    method: 'post',
    data: data
  })
}

//批量添加客观题
export function addobjectquestion(data) {
  return request({
    url: '/template/objectiveQuestion/batchAddOrUpdate',
    method: 'post',
    data: data
  })
}

//根据条件查询所有模板客观题列表 
export function templateobjectiveDate(query) {
  return request({
    url: '/template/objectiveQuestion/getAllList',
    method: 'get',
    params: query
  })
}

//新增基础信息切图/template/field
export function basicinfoCanvasimg(data) {
  return request({
    url: '/template/field',
    method: 'post',
    data: data
  })
}

//获取模板信息切图列表
export function gettemplateClitinfo(query) {
  return request({
    url: '/template/field/getBaseList',
    method: 'get',
    params: query
  })
}

//批量新增主观题 
export function batchAddSubjective(data) {
  return request({
    url: '/template/subjectiveQuestion/batchAddOrUpdate',
    method: 'post',
    data: data
  })
}

//获取主观题列表
export function getsubjectivelist(query) {
  return request({
    url: '/template/subjectiveQuestion/getAllList',
    method: 'get',
    params: query
  })
}

//旋转图片
export function rotatePicture(data) {
  return request({
    url: '/template/page/rotateImage',
    method: 'post',
    data: data
  })
}

//修改客观题答案
export function fixedobjectAanswer(data) {
  return request({
    url: '/template/objectiveQuestion/editAnswer',
    method: 'put',
    data: data
  })
}

//批量删除客观题/template/objectiveQuestion   
export function batchdeleteobjetive(data) {
  return request({
    url: '/template/objectiveQuestion',
    method: 'delete',
    data: data
  })
}

//批量设置答案
export function batchsetAnswer(data) {
  return request({
    url: '/template/objectiveQuestion/batchSettingAnswer',
    method: 'post',
    data: data
  })
}

//导入答案
export function importBatchAnswer(data) {
  return request({
    url: '/template/objectiveQuestion/importAnswer',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: data
  })
}

//获取主观题详情/template/subjectiveQuestion/{id}
export function subjectiveDetail(id) {
  return request({
    url: `/template/subjectiveQuestion/${id}`,
    method: 'get'
  })
}

//删除主观题
export function batchdeletesubject(data) {
  return request({
    url: '/template/subjectiveQuestion',
    method: 'delete',
    data: data
  })
}

//编辑主观题
export function editdeletesubject(data) {
  return request({
    url: '/template/subjectiveQuestion',
    method: 'put',
    data: data
  })
}


//自动识别
export function getautoannotateDate(data) {
  return request({
    url: '/template/template/autoAnnotate',
    method: 'post',
    params: data
  })
}

//一键清空/template/template/cleanAllField
export function clearModeldata(data) {
  return request({
    url: '/template/template/cleanAllField',
    method: 'post',
    params: data
  })
}

//批量修改步长
export function batchSettingStep(data) {
  return request({
    url: '/template/subjectiveQuestion/batchSettingStep',
    method: 'post',
    data: data
  })
}

//设置题组
export function batchquestionGroup(data) {
  return request({
    url: '/template/group',
    method: 'post',
    data: data
  })
}

//查询模板状态轮循
export function autoAnnotateStatus(data) {
  return request({
    url: '/template/template/autoAnnotateStatus',
    method: 'post',
    params: data
  })
}

//基础信息删除定位点
export function bascInfodelete(ids) {
  return request({
    url: `/template/field/${ids}`,
    method: 'delete'
  })
}
//模板完成制作
export function templateComplete(data) {
  return request({
    url: '/template/template/complete',
    method: 'post',
    params: data
  })
}

//查询阅卷状态 
export function examAssignmentstatus(data) {
  return request({
    url: '/template/page/getScanStatus',
    method: 'get',
    params: data
  })
}

//根据学科获取题型 
export function basicQuestionTypeList(data) {
  return request({
    url: '/template/template/basicQuestionTypeList',
    method: 'get',
    params: data
  })
}

// 查询题型管理列表
export function questionlist(id) {
    return request({
        url: `/template/template/basicQuestionTypeList`,
        method: 'get',
        params: id
    })
}
